import React from "react";
import { Navigate, Link } from "react-router-dom";
import LoginLayouts from "../layouts/LoginLayouts";
import IndexLayouts from "../layouts/IndexLayouts";
import BasicLayouts from "../layouts/BasicLayouts";
import Screen from "../pages/Screen";
import Base from "../pages/Base";
import Property from "../pages/Property";
import Allowance from "../pages/Allowance";

import List from "../pages/List";
import Member from "../pages/List/member.js";
import Elderly from "../pages/subsidies/subsidy/elderly";
import Ecological from "../pages/subsidies/subsidy/ecological";
import Employment from "../pages/subsidies/subsidy/employment";
import Farmland from "../pages/subsidies/subsidy/farmland";
import FlexEmployment from "../pages/subsidies/subsidy/flexEmployment";
import Immigration from "../pages/subsidies/subsidy/immigration";
import Internship from "../pages/subsidies/subsidy/internship";
import Student from "../pages/subsidies/subsidy/student";
import IllegalElderly from "../pages/subsidies/doubt/illegalElderly";
import IllegalEcological from "../pages/subsidies/doubt/illegalEcological";
import IllegalEmployment from "../pages/subsidies/doubt/illegalEmployment";
import IllegalFarmland from "../pages/subsidies/doubt/illegalFarmland";
import IllegalFlexEmployment from "../pages/subsidies/doubt/illegalFlexEmployment";
import IllegalImmigration from "../pages/subsidies/doubt/illegalImmigration";
import IllegalInternship from "../pages/subsidies/doubt/illegalInternship";
import IllegalStudent from "../pages/subsidies/doubt/illegalStudent";
import Funds from "../pages/Asserts/funds.js";
import Resources from "../pages/Asserts/resources.js";
import Asserts from "../pages/Asserts/index.js";

import Summary from "../pages/Summary";
import Violation from "../pages/Violation";
import Apply from "../pages/subsidies/Apply.js";
import Feedback from "../pages/Feedback/index.js";




const NoMatch = () => (
  <div style={{ margin: "50px" }}>
    <h3>404 NOT FOUND</h3>
    <Link to="/">返回主页</Link>
  </div>
);
export const routes = [
  { path: "/", element: <Navigate to={"/index"} /> },
  { path: "/index", element: <IndexLayouts /> },
  { path: "/login", element: <LoginLayouts /> },
  { path: "/home", element: <Screen /> },
  { path: "/base", element: <Base /> },
  { path: "/property", element: <Property /> },
  { path: "/allowance", element: <Allowance /> },
  { path: "/*", element: <BasicLayouts /> },
];

// 后台页面路由
export const basicRoutes = [
  { path: "/base/collective", element: <List /> },
  { path: "/base/member", element: <Member /> },
  { path: "/assets/asset", element: <Asserts /> },
  { path: "/assets/resources", element: <Resources /> },
  { path: "/assets/funds", element: <Funds /> },
  { path: "/subsidies/subsidy/elderly", element: <Elderly /> },
  { path: "/subsidies/subsidy/ecological", element: <Ecological /> },
  { path: "/subsidies/subsidy/employment", element: <Employment /> },
  { path: "/subsidies/subsidy/farmland", element: <Farmland /> },
  { path: "/subsidies/subsidy/flexEmployment", element: <FlexEmployment /> },
  { path: "/subsidies/subsidy/immigration", element: <Immigration /> },
  { path: "/subsidies/subsidy/internship", element: <Internship /> },
  { path: "/subsidies/subsidy/student", element: <Student /> },
  { path: "/subsidies/doubt/illegalElderly", element: <IllegalElderly /> },
  { path: "/subsidies/doubt/illegalEcological", element: <IllegalEcological /> },
  { path: "/subsidies/doubt/illegalEmployment", element: <IllegalEmployment /> },
  { path: "/subsidies/doubt/illegalFarmland", element: <IllegalFarmland /> },
  { path: "/subsidies/doubt/illegalFlexEmployment", element: <IllegalFlexEmployment /> },
  { path: "/subsidies/doubt/illegalImmigration", element: <IllegalImmigration /> },
  { path: "/subsidies/doubt/illegalInternship", element: <IllegalInternship /> },
  { path: "/subsidies/doubt/illegalStudent", element: <IllegalStudent /> },

  { path: "/subsidies/summary", element: <Summary /> },
  { path: "/subsidies/violation", element: <Violation /> },
  { path: "/subsidies/apply", element: <Apply /> },

  { path: "/feedback", element: <Feedback /> },  

  { path: "*", element: <NoMatch /> },
];

export default routes;
